package com.jt.controller;

import com.jt.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/axios")
public class AxiosController {
@RequestMapping("/findUser")
    public User findUser(User user){

    return user;
}
@RequestMapping("/findUserById")
public User findUserById(User user){
    user.setName("张三");
    user.setAge(18);
    user.setSex("男");
    return user;
}
@RequestMapping("/findUserByNA")
public User findUserByNA(User user){
    user.setSex("加油");
    user.setId(5);
    return user;

}
@RequestMapping("/userCat")
    public User UserCat(User user){
    user.setId(7);
    user.setSex("生物");
    return user;
}
@PostMapping("/saveUser")
    public User saveUser(@RequestBody User user){
    return user;
}
@PutMapping("/updateUser")
    public User updateUser(@RequestBody  User user){
    return user;
}
 @PutMapping("/updateUser2/{id}/{name}/{age}/{sex}")
    public User updateUser2(User user){
    return user;
    }
    @PutMapping("/updateUser3/{id}/{name}/{age}/{sex}")
    public User updateUser3(User user){
    return user;
    }
}
